/*-----------------------------------------------------------------
   Project    : PlaygroundJ2eeBrasil
   Package    : com.wsc.j2eebrasil.java6
   File name  : JavaScript.java
   Author     : Wilson Soethe Cursino            Date: Apr 16, 2008
   Description:    
   Notes:   
   Revision History:
   Name:           Date:        Description:
  -----------------------------------------------------------------*/
package com.wsc.j2eebrasil.java6.javascript;

import java.util.List;

import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public class JavaScript {
    public static void main(String[] args) {
        try {
            ScriptEngineManager mgr = new ScriptEngineManager();
            List<ScriptEngineFactory> factories = mgr.getEngineFactories();
            System.out.println("Script engines disponiveis:");
            for (int i = 0; i < factories.size(); i++) {
                ScriptEngineFactory factory = factories.get(i);
                String engine = factory.getEngineName();
                String language = factory.getLanguageName();

                System.out.println("-------------------------------------------");
                System.out.println("Language: " + language);
                System.out.println("Engine: " + engine);
                System.out.println("-------------------------------------------");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

